package com.chenxin.springboot.controller;

import com.chenxin.springboot.annotation.RepeatSubmit;
import com.chenxin.springboot.dto.BaseResponse;
import com.chenxin.springboot.dto.RegisterDto;
import com.chenxin.springboot.dto.StatusCode;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("submit")
public class UserController {

    //用户注册
    @RepeatSubmit
    @PostMapping("register")
    public BaseResponse register(@RequestBody RegisterDto dto) throws Exception{
        BaseResponse response=new BaseResponse(StatusCode.Success);
        //log.info("用户注册，提交上来的请求信息为：{}",dto);

        //将用户信息插入到db

        response.setData(dto);
        return response;
    }
}
